/*
 * @Description: 用户相关接口
 * @Author: CrowBlock81192
 * @Date: 2024-03-23 01:02:41
 */

import request from '@/utils/request';
import { loginParamType, loginResultType } from '@/api/type';

interface IResponseType<P = loginResultType> {
	code?: number;
	msg: string;
	data: P;
}

/**
 * @description: 账号密码登录
 * @Author: CrowBlock81192
 * @Date: 2024-03-23 01:06:19
 * @return {*}
 * @param {loginParamType} data
 */
export const loginApi = (data: loginParamType) => {
	return request<IResponseType>({
		url: '/login',
		method: 'post',
		data,
	});
};
